package info.sean.util.secret;

/**
 * 
 * @author sunpan
 * @desc  密文转明文工具类
 * @time  2017年3月29日16:39:27
 *
 */
public class ConverterUtil {
	
	private static IdNumberConverter idNumberConverter = IdNumberConverter.getInstance();
	
	/**
	 * 密文转明文(身份证号)
	 * @param encrypt
	 * @return
	 */
	public static String decryptIdNumber(String encrypt){
		return (String)idNumberConverter.convertDataValueToObjectValue(encrypt, null);
	}
	
	/**
	 * 明文转密文(身份证号)
	 * @param decrypt
	 * @return
	 */
	public static String encryptIdNumber(String decrypt){
		return (String)idNumberConverter.convertObjectValueToDataValue(decrypt, null);
	}

	public static void main(String[] args) {
		String IdNumber = "342601199711157144";
		String encryptIdNumber = encryptIdNumber(IdNumber);
		System.out.println("encryptIdNumber = " + encryptIdNumber);
		String decryptIdNumber = decryptIdNumber(encryptIdNumber);
		System.out.println("decryptIdNumber = " + decryptIdNumber);
	}
}
